<?php
class Zend_View_Helper_UserThumbnail extends Zend_View_Helper_Abstract {
	
    public $view;
    
    public function setView(Zend_View_Interface $view) {
        $this->view = $view;
    }
    
	public function userThumbnail($user) {
		
		$config = Zend_Registry::get('config');
		$baseUrl = $config->baseurl;
		
		if (!empty($user->square_img)) {
			if (substr($user->square_img,0,4) == "http") {
                return $user->square_img;
			} else {
				return $baseUrl."/custom_uploaded/thumbnail/".$user->square_img;
			}
		} else {
			return $baseUrl."/img/no_pic_thumbnail.jpg";
		}
	}
}
?>